'''
Created on 2017年4月20日

@author: Administrator
'''
from django.core.management.base import BaseCommand
from comment.models import Comment
from comment.utils import get_comment_childrens

class Command(BaseCommand):
    """
    **更新评论楼层*
    """
    def handle(self, *args, **options):
        comments = Comment.objects.filter(parent=None).order_by("create_time")
        for comment in comments:
            chilrders = get_comment_childrens(comment)
            
